home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Intercept
/
Visual Intercept.iso
/
sheriff.z
/
issherff.frm
< prev
next >
Wrap
Text File
|
1996-08-26
|
10KB
|
346 lines
VERSION 4.00
Begin VB.Form ISSHERIFF
BorderStyle = 1 'Fixed Single
Caption = "Incident Form Title"
ClientHeight = 5400
ClientLeft = 1470
ClientTop = 1800
ClientWidth = 6630
Height = 5805
Left = 1410
LinkTopic = "Form1"
ScaleHeight = 360
ScaleMode = 3 'Pixel
ScaleWidth = 442
Top = 1455
Width = 6750
Begin VB.TextBox txtDescription
BackColor = &H00FFFFFF&
ForeColor = &H00000000&
Height = 2655
Left = 240
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 7
Top = 1920
Width = 6135
End
Begin VB.TextBox txtSubject
BackColor = &H00FFFFFF&
ForeColor = &H00000000&
Height = 330
Left = 240
MultiLine = -1 'True
TabIndex = 6
Top = 1200
Width = 6135
End
Begin VB.ComboBox AvailableProjects
BackColor = &H00FFFFFF&
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 300
Left = 240
Style = 2 'Dropdown List
TabIndex = 2
Top = 480
Width = 6135
End
Begin VB.CommandButton cmdSend
Caption = "Send"
BeginProperty Font
name = "Arial"
charset = 0
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 1
Top = 4800
Width = 1335
End
Begin VB.CommandButton cmdClose
Caption = "Cancel"
BeginProperty Font
name = "Arial"
charset = 0
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 375
Left = 3600
TabIndex = 0
Top = 4800
Width = 1335
End
Begin VB.Label Label3
Caption = "Description"
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 5
Top = 1680
Width = 1335
End
Begin VB.Label Label2
Caption = "Subject"
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 4
Top = 960
Width = 975
End
Begin VB.Label Label1
Caption = "Project"
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 3
Top = 240
Width = 855
End
End
Attribute VB_Name = "ISSHERIFF"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
'----------------------------------------------------------------------------
' issherff.frm is a member of the Visual Intercept Visual Basic API.
' Copyright (c) 1996 Elsinore Technologies, Inc. All rights reserved.
'
' This software is protected by copyright law. Unauthorized reproduction
' or distribution of this program, or any portion of it, may result in
' severe civil or criminal penalties. If you have any questions about
' your redistribution rights, please contact Elsinore Technologies, Inc.
'
' Creator: Albert J. Lin (AJL)
' History: Created 09/17/95
'----------------------------------------------------------------------------
'============================================
' Visual Intercept Sheriff global definitions
'============================================
Private gSheriffRecord As ISSheriffRecord ' Configuration information
Private Function EnableState()
Dim bEnable As Boolean
Dim text As String
bEnable = True
' Determine if we can Send the incident yet
' A subject, description, and project must be specified
If AvailableProjects.ListCount = 0 Then
bEnable = False
Else
If AvailableProjects.ListIndex = -1 Then
bEnable = False
Else
text = Trim(txtSubject.text)
If Len(text) = 0 Then
bEnable = False
Else
text = Trim(txtDescription.text)
If Len(text) = 0 Then
bEnable = False
End If
End If
End If
End If
cmdSend.Enabled = bEnable
End Function
Private Function Finished()
MousePointer = cursorWait
Unload Me
MousePointer = cursorNormal
End Function
Private Function LoadIncident(ByRef rIncident As VIIncident)
' This method goes through the form and collects the incident
' submission information.
Dim projectName As String
Dim nTotal As Integer
Dim nIndex As Integer
' Get the project information from the form
' We must loop through looking for a match in case the user decides
' to change the sort order of the project list box.
nIndex = AvailableProjects.ListIndex ' Get the selected project
projectName = AvailableProjects.List(nIndex) ' Get the project name to search with
nTotal = AvailableProjects.ListCount ' Get the number of projects available
For nIndex = 0 To nTotal - 1 ' loop through original looking for match
If StrComp(projectName, gSheriffRecord.projects(nIndex).name, 1) = 0 Then
rIncident.projectName = gSheriffRecord.projects(nIndex).name
rIncident.versionName = gSheriffRecord.projects(nIndex).version
rIncident.assignedID = gSheriffRecord.projects(nIndex).leadID
Exit For
End If
Next nIndex
' Get the dynamic input information from the form
rIncident.subject = txtSubject
rIncident.description = txtDescription
' Load the default data from the IIRecord
rIncident.requesterID = gSheriffRecord.requesterID
If Len(rIncident.assignedID) = 0 Then ' if no project lead
rIncident.assignedID = gSheriffRecord.assignedID ' use developer who executed Add-in
End If
rIncident.category = gSheriffRecord.category
rIncident.status = gSheriffRecord.status
rIncident.priority = gSheriffRecord.priority
rIncident.severity = gSheriffRecord.severity
End Function
Private Sub AvailableProjects_Click()
EnableState
End Sub
Private Sub cmdClose_Click()
Finished
End Sub
Private Sub cmdClose_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
MousePointer = 11 ' Change mouse pointer to hourglass.
End Sub
Private Sub cmdClose_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
MousePointer = 0
End Sub
Private Sub cmdSend_Click()
Dim parameters As VILogonParameters
Dim incident As VIIncident
Dim err As Long
Dim exitErr As Long
err = 0
MousePointer = cursorWait
' Initialize logon parameters
parameters.server = gSheriffRecord.server
parameters.userID = gSheriffRecord.userID
parameters.password = gSheriffRecord.password
parameters.systemUserID = gSheriffRecord.systemUserID
parameters.systemPassword = gSheriffRecord.systemPassword
parameters.data = 0
parameters.options = gSheriffRecord.options + viSilent
parameters.hWnd = 0
' Initialize the incident and fill in appropriate information
Call LoadIncident(incident)
' Logon Visual Intercept and send the Incident
err = VBIILogon(parameters)
If err = 0 Then
err = VBIIInsertIncident(incident)
exitErr = VBIILogoff()
End If
VBIIError (err)
MousePointer = cursorNormal
Finished
End Sub
Private Sub Form_Load()
Dim nIndex As Long
Dim nProjects As Long
Call VBIILoadRecord(gSheriffRecord)
'Set the form title
Me.Caption = gSheriffRecord.formTitle
'Clean out any previous references
AvailableProjects.Clear
'Load up available projects
nProjects = gSheriffRecord.nProjects
For nIndex = 0 To nProjects - 1
AvailableProjects.AddItem gSheriffRecord.projects(nIndex).name
Next nIndex
'Default to the first project
AvailableProjects.ListIndex = 0
End Sub
Private Sub txtDescription_KeyUp(KeyCode As Integer, Shift As Integer)
EnableState
End Sub
Private Sub txtSubject_KeyUp(KeyCode As Integer, Shift As Integer)
EnableState
End Sub